<openerp>
<data>
		<record id="view_move_line_tree_applico" model="ir.ui.view">
            <field name="name">view.account.move.line.tree.applico</field>
            <field name="model">tracking.journal.items</field>
            <field name="arch" type="xml">
            	<tree string="Journal Items" position="replace">
            		<tree string="Journal Items Tracking" create="0" edit="0" delete="false" colors="red:state == 'draft';black:state == 'valid'">
	                    <field name="journal_id" readonly="1" options='{"no_open":True}' invisible="context.get('journal_id',False)"/>
	                    <field name="period_id" readonly="1" options='{"no_open":True}' invisible="context.get('period_id',False)"/>
	                    <field name="date" readonly="1"/>
	                    <field name="name"/>
	                    <field name="ref"/>
	                    <field name="statement_id" invisible="1"/>
	                    <field name="partner_id"
	                        domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"/>
	                    <field name="account_id" options='{"no_open":True}' domain="[('journal_id','=',journal_id), ('company_id', '=', company_id)]" on_change="onchange_account_id(account_id, partner_id, context)"/>
	                    <field name="account_tax_id" options='{"no_open":True}' invisible="context.get('journal_type', False) not in ['sale','sale_refund','purchase','purchase_refund','general']"/>
	                    <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type','not in',['view','template'])]" invisible="not context.get('analytic_journal_id',False)"/>
	                    <field name="move_id" required="0"/>
	                    <field name="debit" sum="Total Debit"/>
	                    <field name="credit" sum="Total Credit"/>
	                    <field name="date_maturity" invisible="context.get('journal_type', False) not in ['sale','sale_refund','purchase','purchase_refund']"/>
	                    <field name="reconcile_ref"/>
	                    <field name="invoice" invisible="1"/>
	                    <field name="amount_currency" readonly="True" invisible="not context.get('currency',False)"/>
	                    <field name="currency_id" readonly="True" invisible="not context.get('currency',False)" />
	                    <field name="state" invisible="1"/>
	                    <field name="company_id" invisible="1"/>
	                </tree>
            	</tree>
            </field>
        </record>
        <record id="view_account_move_line_filter_applico" model="ir.ui.view">
            <field name="name">Journal Items</field>
            <field name="model">tracking.journal.items</field>
            <field name="arch" type="xml">
                <search string="Search Journal Items">
                    <field name="name" filter_domain="['|', ('name','ilike',self), ('ref','ilike',self)]" string="Move"/>
                    <field name="date"/>
                    <filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
                    <separator/>
                    <filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
                    <filter name="posted" icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
                    <separator/>
                    <filter icon="terp-dolar_ok!" string="Unreconciled" domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items" name="unreconciled"/>
                    <separator/>
                    <filter string="Next Partner to Reconcile" help="Next Partner Entries to reconcile" name="next_partner" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
                    <field name="move_id" string="Number (Move)"/>
                    <field name="account_id"/>
                    <field name="partner_id"/>
                    <field name="journal_id" context="{'journal_id':self}" widget="selection"/> <!-- it's important to keep widget='selection' in this filter viewbecause without that the value passed in the context is not the ID but the textual value (name) of the selected journal -->
                    <field name="period_id" context="{'period_id':self}" widget="selection"/> <!-- it's important to keep the widget='selection' in this field, for the same reason as explained above -->
                    <group expand="0" string="Group By">
                        <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                        <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
                        <filter string="Account"  icon="terp-folder-green" context="{'group_by':'account_id'}"/>
                        <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
                    </group>
                </search>
            </field>
        </record>
        <record id="action_account_moves_all_applico" model="ir.actions.act_window">
            <field name="context">{'journal_type':'general'}</field>
            <field name="name">Journal Items</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">tracking.journal.items</field>
            <field name="view_id" ref="view_move_line_tree_applico"/>
            <field name="search_view_id" ref="view_account_move_line_filter_applico"/>
            <field name="view_mode">tree</field>
            <field name="help" type="html">
              <p>
                This view can be used by accountants in order to quickly record
                entries in Odoo. If you want to record a supplier invoice,
                start by recording the line of the expense account. Odoo
                will propose to you automatically the Tax related to this
                account and the counterpart "Account Payable".
              </p>
            </field>
        </record>
        <menuitem
            action="action_account_moves_all_applico"
            icon="STOCK_JUSTIFY_FILL"
            id="menu_tracking_journal_items"
            parent="account.menu_finance_entries"
            sequence="2"
        />
</data>
</openerp>
